Skip to main content

Creating File Data Sets

5 Tasks

25 mins

Visible to: All users
Beginner Pega Platform English

Scenario

In the Sample application, a new Sample-Data-Countries class is created with the following Data Model:

Field Type Description

UniqueID

Identifier

Unique if of the country

Country

Text

Name of the country

A SampleCountries.csv file is available in the system for your convenience.

Create an embedded file Data Set with the SampleCountries.csv file, and then use the file to create an additional property available in the CSV file.

Create a File Data Set to access Countries.csv file in the repository.

Use the following credentials to log in to the exercise system:

Role User name Password
System architect SystemArchitect Rules

Your assignment consists of the following tasks:

Task 1: Download the CSV file to your local drive

The SampleCountries CSV file is available on the system through a binary file Rule. Download the file to your local drive.

Task 2: Create a new File Data Set for an embedded file

Create a new File Data Set named SampleCountries that contains the SampleCountries.csv file. Then, use the embedded file structure to create a new property called Abbreviation in the Sample-Data-Countries class.

Task 3: Preview the data in the embedded file

Browse the data that is available in the embedded file in the File Data Set.

Task 4: Create a new File Data Set for a repository file

Create a new File Data Set named Countries that contains the full list of countries.

Note: For the purposes of this exercise, a file repository (filerepo) is created for you. In the repository, the Countries.csv is available in the folder FileDataSet.

Task 5: Preview the data in the repository file

Browse the data available in the file repository.

 

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Challenge Walkthrough

Detailed Tasks

1 Download the CSV file to your local drive

  1. Log in as the System Architect:
    1. In the User name field, enter SystemArchitect.
    2. In the Password field, enter Rules.
  2. In the header of Dev Studio, in the search field, enter SampleCountries, and then click Search.
  3. In the list of results, click Countries SampleCountries CSV.
    Countries SampleCountries file
    Note: For this exercise, the CSV file is stored in the system in a binary file for ease of access. Typically, files are stored in dedicated repositories.
  1. On the Rule form, click Download file to download the file to your local drive.
    Download file

2 Create a new File Data Set for an embedded file

  1. In the navigation pane of Dev Studio, click App to open the Application Explorer.
  2. In the Application Explorer, search for the Sample-Data-Countries class.
  3. In the Application Explorer, right-click on the Sample-Data-Countries class, then select Create > Data Model > Data Set.
  4. On the Create Data Set tab, create a new Data Set:
    1. In the Label field, enter Sample Countries.
    2. In the Type list, select File.
    3. In the upper-right corner, click Create and open.
      The creation of the Sample Countries Data Set
  5. On the Edit Data set: Sample Countries tab, complete the following settings:
    1. In the File location section, select Embedded file.
    2. In the File management section, click Upload file.
    3. On the Upload file window, click Choose File.
    4. Select the samplecountries.csv file that you downloaded in the initial task.
      The samplecountriescsv file in the Sample Countries Data Set
  6. On the Edit Data set: Sample Countries Rule form, click the Mapping tab. Note that there is the Abbreviation column does not have a mapped property.
    Mapping tab
    1. On the Mapping tab, click Create missing properties.
    2. In the Properties Generation window, click Create to create the missing property.
      The Properties Generation window
    3. Click OK.
  7. In the upper-right corner, click Save.

3 Preview the data in the embedded file

  1. On the Data set: Sample Countries tab, in the upper-right corner, click Actions > Run.
  2. In the Run Data Set: Sample Countries window, view the data:
    1. In the run context, in the Operation list, select Browse.
    2. In the upper-right corner of the run context, click Run to view the run results.
    3. Browse through the results.
      The results of the Sample Countries Data Set
    4. Close the Data Set Preview window.
    5. Close the Run Data Set: Sample Countries window.

4 Create a new File Data Set for a repository file

  1. In the Application Explorer, right-click the Sample-Data-Countries class, then select Create > Data Model > Data Set.
  2. On the Create Data Set tab, create a new Data Set:
    1. In the Label field, enter Countries.
    2. In the Type list, select File.
    3. In the upper-right corner, click Create and open.
  3. On the Edit Data set: Countries tab, complete the following settings:
    1. In the File location section, confirm that Files on repository is selected.
    2. In the Configuration section, in the Repository configuration list, enter or select filerepo.
    3. In the File path, enter /FileDataSet/Countries.csv.
    4. Click Preview file.
      The file preview for the Countriescsv file
    5. Click Close.
  4. In the File configuration section, click Configure automatically.
    The File configuration section
  5. On the Edit Data set: Sample Countries Rule form, click the Mapping tab. Note that all columns have mappings.
  6. In the upper-right corner, click Save.

5 Preview the data in the repository file

  1. On the Data set: Countries tab, in the upper-right corner, click Actions > Run.
  2. In the Run Data Set: Countries window, preview the data:
    1. In the run context, in the Operation list, select Browse.
    2. In the upper-right corner of the run context, click Run to view the run results.
    3. Browse through the results.
      The run results of the Sample Countries Data Set

This Challenge is to practice what you learned in the following Module:


Available in the following mission:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice